package ToolPack;

import MaterialPack.IPortable;
import MaterialPack.Solid;

import java.util.ArrayList;

/**
 * Created by Aaron on 8/10/2014.
 */
public class PortableContainer extends Container {
    private ArrayList<IPortable> inventory;
    private int inventorySize;

    public PortableContainer (int inventorySize) {
        inventory = new ArrayList<>();
        this.inventorySize = inventorySize;
    }

    public ArrayList<IPortable> getInventory ( ) {
        return this.inventory;
    }

    public boolean addPortable (IPortable portable) {
        return (this.inventory.size() < this.inventorySize ? this.inventory.add(portable) : false);
    }

    public boolean removePortable (IPortable portable) {
        return (this.inventory.contains(portable) ? this.inventory.remove(portable) : false);
    }
}
